Date formatting system

ABSTRACT

A date formatting system for a computer program to perform date operations where the dates span more than one century. In a first embodiment, a 6-integer file system in CYYDDD format is used, “C” being a variable indicating the century, YY indicating years, and DDD indicating days of the year. A second embodiment utilizes a 7-digit integer data file and is in YYYYDDD format. These two embodiments help avoid problems experienced by computer programs that use 2-digits to identify years.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a method for operating acomputer system to perform date operations, and more particularly, to amethod for operating a computer system to accurately perform dateoperations spanning centuries.

[0003] 2. Description of the Related Art

[0004] Most existing computer application software treats a date in aformat similar to “MM/DD/YY” or “YY/DDD,” using 2 digits of a 4 digityear number, resulting in 2 digit year numbers. For example, the year1998 is input, stored, processed and displayed as “98”. However,starting at the year 2000, this treatment will cause problems because“00” could be interpreted as either “1900” or, “2000,” and, for example,the length of a period from 1998 to 2000 could be negative if 98 issubtracted from 2000. This problem is0 known as the “Year 2000 (Y2K)Problem” in the industry, and has been considered a crisis.

[0005] Several inventions attempt to solve the Y2K problem by providingcomplex and expensive computer programs. A discussion of related,representative art follows.

[0006] One such invention is described in U.S. Pat. No. 5,289,393 whichissued to S. Kaya on Feb. 22, 1994. This invention is a portableelectronic apparatus having a calendar feature which stores the year in4 digits.

[0007] U.S. Pat. No. 5,600,836 which issued to H. Alter on Feb. 4, 1997,discloses a system and method for processing date-dependent informationwhich spans one or two centuries. The invention includes time changeinterfaces that convert date data from local, time to zone time so thatall of the dates are in one century, as well as a method of convertingfrom zone time back to local time.

[0008] U.S. Pat. No. 5,630,118 which issued to D. P. Shaughnessy on May13, 1997, discloses a system and method for modifying and operating acomputer system to perform date operations on date fields spanningcenturies. The system comprises a subroutine that determines which dateswithin the program correspond to specified date criteria and performs adate operation on the date field.

[0009] U.S. Pat. No. 5,644,762 which issued to T. B. Soeder on May 14,1996, discloses a method and apparatus for recording and reading datedata having coexisting formats. The invention uses a system wherebyyears past 1999 are stored as binary integers in fields previouslyreserved for representations of years as two decimal digits, so that thelast two decimal digits will be able to coexist for at least tenthousand years.

[0010] U.S. Pat. No. 5,668,989 which issued to D. Mao on Sep. 16, 1997,discloses a system employing two-digit hybrid radix year numbers for theyear 2000 and beyond. This system treats the higher digit ashexadecimal, but displays the digit in a decimal-like style, while thelower digit is treated as ordinary decimal, so that the year 1900 isrepresented by 00 and the year 2000 is represented as '00.

[0011] British Patent No. 2,312,536 which was published on Oct. 29, 1997and issued to Anderson et al., discloses a method and apparatus foridentifying and correcting date errors. The invention consists of asuite of computer programs used together to detect and correct year 2000problems in a personal computer. One aspect of the invention involvesthe correcting the century value, of the date operations a computer whenthe computer rolls over to the year 2000.

[0012] Lastly, The Year 2000 and 2-Digit Dates: A Guide for Planning andImplementation, 3d ed., published by IBM in May, 1996, discloses threesolutions and techniques for solving “Y2K” problems. The first techniqueinvolves conversion to full 4-digit year formats (DDDD) from 2-digityear (DD) formats, the second technique involves windowing techniques,namely, externalizing 2-digit or 4-digit year formats, and the thirdtechnique involves using a 2-digit encoding/compression scheme, whereby4-digit year data are compressed into 2-digit existing space.

[0013] None of the above inventions and patents, taken either singularlyor in combination, is seen to describe the instant invention as claimed.Thus, a date formatting system solving the aforementioned problems isdesired.

SUMMARY OF THE INVENTION

[0014] The present invention provides a method which can be incorporatedinto the application processing logic of a computer program whose dateoperations would otherwise fail as a result of date operations utilizing2-digit representation for the year. For example, the 2-digit code “00”could be representative of either the year 1900 or the year 2000.

[0015] According to a first embodiment of the invention, a 6-integerfile system in CYYDDD format is used, “C” being a variable indicatingthe century. A second embodiment utilizes a 7-digit integer data fileand is in YYYYDDD format. These two embodiments help avoid “year 2000”problems by using a year format in excess of 2-digits.

[0016] Accordingly, it is a principal object of the invention to providea date formatting system that enables computer programs to avoid the“year 2000” crisis.

[0017] It is another object of the invention to provide a dateformatting system that is easy to use in conjunction with a computerprogram.

[0018] It is an object of the invention to provide improved elements andarrangements thereof for the purposes described which is inexpensive,dependable and fully effective in accomplishing its intended purposes.

[0019] These and other objects of the present invention will becomereadily apparent upon further review of the following specification anddrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0020]FIG. 1 is a schematic block diagram of a computer system that maybe used to practice the date formatting system according to the presentinvention.

[0021]FIG. 2 is a diagram of a sample data file of the prior art.

[0022]FIG. 3 is a diagram of a sample data file of the first embodimentof the invention.

[0023]FIG. 4 is a data conversion chart used to practice the presentinvention

[0024]FIG. 5 is a flowchart illustrating the steps the date formattingsystem takes when adding days of the year.

[0025]FIG. 6 is a diagram of a sample data file of the second embodimentof the invention.

[0026] Similar reference characters denote corresponding featuresconsistently throughout the attached drawings.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0027] Referring to the drawings wherein like numerals represent likeelements, FIG. 1. illustrates an exemplary computer system 10 that mayinclude the date formatting system of the present invention. Thecomputer system 10 has an input device 12, a CPU (central processingunit) 14, a memory device 16 and a display device 18. The operation ofthe computer system 10 is governed by a computer software program thatis stored in the memory device 16.

[0028] A typical software program has numerous routines that perform thetasks that the program was designed to perform, such as alphabetize,sort or otherwise move text. More often than not, such programsadditionally include a routine such as a date operation such as a datecomparison.

[0029] The date operations often encoded in such software programs use atwo-digit representation for the year. In such a case, the dateoperations may be erroneously performed when processing dates after Dec.31, 1999 for the reasons discussed above. FIG. 2 shows prior art datafiles 20 utilizing such a two-digit representation for the year 21, eachdata file having 6 integers. For illustrative purposes, Dec. 25, 1998and Dec. 25, 2000 are shown in MMDDYY format, a two year differenceexisting between these two dates. When Dec. 25, 2000 is subtracted fromDec. 25, 1998, a 98-year difference is shown, clearly an errorassociated with the Y2K problem.

[0030] Referring now to FIGS. 3-4, the date formatting system accordingto the first embodiment of the present invention is shown. The firstembodiment also utilizes a 6-integer file system 22, as shown in FIG. 3,so that the system takes up no more memory than systems of the priorart. However, rather than storing date data in MMDDYY format, the firstembodiment stores it in CYYDDD format, “C” indicating the century 23.

[0031] For example Dec. 25, 1998 would be shown as 298359, as shown inFIG. 4., “2” indicating the 20th century, “98” indicating the year, and“359” indicating the 359th day of the year. Therefore, when Dec. 25,1998, or 298359 is subtracted from Dec. 25, 2000, or 300359, adifference of two years is shown, or 002000, indicating two years, zerodays. Similarly, subtracting Jun. 1, 1998, or 298152, from Jul. 17,2007, or 307198 results in the difference of 009046, or nine years and46 days.

[0032] Adding days to these six-integer files will similarly avoid anyY2K problems. For, example to determine the date 2 years and 200 daysfrom Jan. 1, 1999, simply add 002200+299001, which is equal to 301201 orJul. 20, 2001.

[0033] Referring now to FIG. 5, the procedure performed when adding daysto a certain date is illustrated. For example processing the date Mar.30, 1999, is shown at step S1. At step S2, the computer would then adddays to this date. For example, adding four years 300 days Mar. 31,1999, which in CYYDDD format is 004300+299090. The result yielded is303390. In step S3 the system determines whether the last three integersin the file, or the DDD portion is in excess of 365, or 366 in the eventof a leap year. In such a case, the system adds 635 to this number, asshown in step S4. This would change the result 303390 to 304025, or Jan.25, 2004. Should the DDD portion be less than 365, or 366 in the eventof a leap year, then the system returns to date processing, as shown instep S5.

[0034] Referring now to FIG. 6, a second embodiment of the dateformatting system is shown. The first embodiment utilizes a 6-integerdata file 22, shown in FIG. 3, and is in CYYDDD format with the firstinteger functioning as a century variable 23. The second embodimentutilizes a 7-digit integer data file 24 and is in YYYYDDD format. Whilethe second embodiment uses a slightly larger data file 22 that the6-digit integer data file of the first embodiment, the second embodimentrelies on a simpler date operation process, as there is no “C” variable.

[0035] As shown in FIG. 6, May 2, 1998 is shown in YYYYDDD format, or2000122, and Feb. 3, 2000 is shown as 1998034. Subtracting 1998034 from2000122 yields 0002088, or 2 years, 88 days. In the event that the DDDformat is greater than 365, or 366 in the event of a leap year, aprocedure similar to that in FIG. 5 is utilized.

[0036] It is to be understood that the present invention is not limitedto the embodiments described above, but encompasses any and allembodiments within the scope of the following claims.

I claim:
 1. A date formatting system comprising: a computer readablememory storage medium, said medium storing a plurality of date files,each said date file having 6 integers and comprising: a 4 digit decimalyear represented in a first three integer form, the last two of saidfirst three said integers representing the last two digits of the 4digit decimal year, the first of said first three said integersrepresenting a designated century; and a 3 digit decimal day representedin a second three integer form, said second three integers representinga day of a year; whereupon addition to or subtraction of at least two ofsaid plurality of date files, the respective sums and differences can becomputed and maintained after year 1999; and a central processing unitfor carrying out said addition and said subtraction operations.
 2. Thedate formatting system of claim 1 wherein said first of said first threesaid integers representing a designated century are selected from thegroup ranging from 1 through 9, and wherein: The integer 1 representsthe 19th Century; The integer 2 represents the 20th Century; The integer3 represents the 21st Century; The integer 4 represents the 22ndCentury; The integer 5 represents the 23rd Century; The integer 6represents the 24th Century; The integer 7 represents the 25th Century;The integer 8 represents the 26th Century; and The integer 9 representsthe 27th Century.
 3. A date formatting system comprising: a computerreadable memory storage medium, said medium storing a plurality of datefiles, each said date file having 7 integers and comprising: a 4 digitdecimal year represented in first four said integers; and a 3 digitdecimal day represented in last three said integers, said second threeintegers representing a day of a year; whereupon addition to orsubtraction of at least two of said plurality of date files, therespective sums and differences can be computed and maintained afteryear 1999; and a central processing unit for carrying out said additionand said subtraction operations.
 4. A series of operational steps to beperformed on or with the aid of a computer, said steps comprising:providing a computer-readable storage medium storing a plurality of datefiles, each said date file having 6 integers and comprising: a 4 digitdecimal year represented in a first three integer form, the last two ofsaid first three said integers representing the last two digits of the 4digit decimal year, the first of said first three said integersrepresenting a designated century; and a 3 digit decimal day representedin a second three integer form, said second three integers representinga day of a year; adding said integers of one of said plurality of filesto another of said plurality of files to generate a sum, and optionally;whenever necessary, adding 635 to said sum; and providing a centralprocessing unit to carry out said adding of said integers.